<div class="box white_bg">

<br/><b><?=t(5004) ?>!</b>
 <?=t(6105) ?> <a href="#" id="new-gallery"> <?=t(9) ?> </a> <?=t(6106) ?> <a href="#TODO"> <?=t(9) ?> </a><?=t(6107) ?> <?=$this->viewParams['content_type'] ?> <?=t(6108) ?>
 <br/><br/>
<?
	$sess = new Zend_Session_Namespace(CLU_NS);
?>
<script type="text/javascript" charset="utf-8">
 jQuery(document).ready(function(){
 		content_type = '<?=$this->viewParams['content_type'] ?>';
 		content_id = <?=$this->viewParams['content_id'] ?>;
		$("#new-gallery").click(function(){
			$.getJSON(
				"/<?=$sess->viewLang?>/gallery/ajax/add-gallery",
				{
					"content_type" : content_type,
					"content_id" : content_id,
					<? if ($this->viewParams['content_type'] == "node") :?>
					"node_type" : "<?=$this->viewParams['node_type']?>"
					<?endif ?>
				},
				function (json)
				{
					if (json.success)
					{
						alert("<?=t(6109)?> #" + json.galleryId);
						window.location.href =  "<?=$_SERVER['REQUEST_URI']?>";
						window.location.reload();
					}
					else
						alert (json.errorMessage);	
				}
				
		
			);
		});
})
</script>

</div>